package org.streets.eis.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import org.streets.database.annotations.NestedFetch;

@Entity(name="EIS_CODE_GROUP")
public class CodeGroup {
	@Id
	public String id;
	
	@Column(name="name")
	public String name;
	
	@Column(name="flag")
	public String flag;
	
	@Column(name="show_index")
	public Integer showIndex;	
	
	@NestedFetch(
		value="select * from eis_code_item where item_level<2 and group_id = :id",
		type = CodeItem.class
	)
	private List<CodeItem> items;

	public CodeGroup() {
		
	}
	
	public List<CodeItem> getItems() {
		return items;
	}

	public void setItems(List<CodeItem> items) {
		this.items = items;
	}
}
